export function getLngLatByCartesian3 (position) {
    const {
        longitude,
        latitude,
        height
    } = Cesium.Cartographic.fromCartesian(position)
    const lng = Cesium.Math.toDegrees(longitude)
    const lat = Cesium.Math.toDegrees(latitude)
    return [lng, lat, height]
}

export function getCartesian3 (position) {
    if(position instanceof Cesium.Cartesian3){
        return position
    } else if(position instanceof Cesium.Cartographic){
        return Cesium.Cartographic.toCartesian(cartographic)
    } else if(position instanceof Array){
        return Cesium.Cartesian3.fromDegrees(...position)
    }
}